package com.leo.apptest.activity;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.MotionEvent;
import android.view.View;
import android.widget.Button;

import com.leo.apptest.R;

public class ViewActivity extends AppCompatActivity {

    private Button mBtView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_view);
        mBtView = (Button) findViewById(R.id.btView);
        mBtView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                System.out.println("tiggger onClickListener");
            }
        });

        mBtView.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View v, MotionEvent event) {
                System.out.println("tigger onTouchListener event "+event.getAction());
                return true;
            }
        });
    }
}
